//
//  XJPayPasswordModifyView.m
//  XinJiangMall
//
//  Created by RaoBo on 2018/5/24.
//  Copyright © 2018年 Tzyang. All rights reserved.
//

#import "XJPayPasswordModifyView.h"
@interface XJPayPasswordModifyView()
@property(nonatomic, strong) UIButton *sureModifyButton; // 确认修改

@end

@implementation XJPayPasswordModifyView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
    }
    return self;
}

- (void)setupView {
    [self addSubview:self.ppPwdTextField];
    [self addSubview:self.ppSurePwdTextField];
    [self addSubview:self.sureModifyButton];
}

#pragma mark - 二 lazy
- (ZYTextField *)ppPwdTextField {
    if (!_ppPwdTextField) {
        _ppPwdTextField = [[ZYTextField alloc] initWithFrame:CGRectMake(ADAPTWidth(23), ADAPTHeight(30), KWidth - ADAPTWidth(23)*2, ADAPTHeight(50)) placeholder:@"请输入6位支付密码" keyboardType:(UIKeyboardTypePhonePad) leftViewImageName:@"login_password" textEntry:YES];
    }
    return _ppPwdTextField;
}

- (ZYTextField *)ppSurePwdTextField {
    if (!_ppSurePwdTextField) {
        _ppSurePwdTextField = [[ZYTextField alloc] initWithFrame:CGRectMake(ADAPTWidth(23), ADAPTHeight(30+50), KWidth - ADAPTWidth(23)*2, ADAPTHeight(50)) placeholder:@"请输入6位支付密码" keyboardType:(UIKeyboardTypePhonePad) leftViewImageName:@"login_password" textEntry:YES];
    }
    return _ppSurePwdTextField;
}

- (UIButton *)sureModifyButton{
    if (!_sureModifyButton) {
        _sureModifyButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        
        _sureModifyButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [_sureModifyButton setTitle:@"确认修改" forState:(UIControlStateNormal)];
        [_sureModifyButton setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
        _sureModifyButton.backgroundColor = XJCOLOR_RGB(255, 216, 67);
        _sureModifyButton.layer.masksToBounds = YES;
        _sureModifyButton.layer.cornerRadius = 10;
        _sureModifyButton.frame = CGRectMake(ADAPTWidth(23), ADAPTHeight(80+80), KWidth - ADAPTWidth(23)*2, ADAPTHeight(50));
        
        [_sureModifyButton addTarget:self action:@selector(modifyButtonAction) forControlEvents:(UIControlEventTouchUpInside)];
    }
    return _sureModifyButton;
}

#pragma mark - 三 事件回调
- (void)modifyButtonAction {
//    XJLog(@"确认修改");
    
    if (self.payPasswordModifyViewClickButtonBlock) {
        self.payPasswordModifyViewClickButtonBlock();
    }
}


@end
